<div class="content-section introduction">
    <div>
        <span class="feature-title">Sidebar</span>
        <span>Sidebar is a panel component displayed as an overlay.</span>
    </div>
</div>

<div class="content-section implementation">
    <p-sidebar [(visible)]="visibleSidebar1" [baseZIndex]="10000">
        <h1 style="font-weight:normal">Left Sidebar</h1>
        <button pButton type="button" (click)="visibleSidebar1 = false" label="Save" class="ui-button-success"></button>
        <button pButton type="button" (click)="visibleSidebar1 = false" label="Cancel" class="ui-button-secondary"></button>
    </p-sidebar>

    <p-sidebar [(visible)]="visibleSidebar2" position="right" [baseZIndex]="10000">
        <h1 style="font-weight:normal">Right Sidebar</h1>
        <button pButton type="button" (click)="visibleSidebar2 = false" label="Save" class="ui-button-success"></button>
        <button pButton type="button" (click)="visibleSidebar2 = false" label="Cancel" class="ui-button-secondary"></button>
    </p-sidebar>

    <p-sidebar [(visible)]="visibleSidebar3" position="top" [baseZIndex]="10000">
        <h1 style="font-weight:normal">Top Sidebar</h1>
        <button pButton type="button" (click)="visibleSidebar3 = false" label="Save" class="ui-button-success"></button>
        <button pButton type="button" (click)="visibleSidebar3 = false" label="Cancel" class="ui-button-secondary"></button>
    </p-sidebar>

    <p-sidebar [(visible)]="visibleSidebar4" position="bottom" [baseZIndex]="10000">
        <h1 style="font-weight:normal">Bottom Sidebar</h1>
        <button pButton type="button" (click)="visibleSidebar4 = false" label="Save" class="ui-button-success"></button>
        <button pButton type="button" (click)="visibleSidebar4 = false" label="Cancel" class="ui-button-secondary"></button>
    </p-sidebar>

    <p-sidebar [(visible)]="visibleSidebar5" [fullScreen]="true" [baseZIndex]="10000">
        <h1 style="font-weight:normal">Full Screen Sidebar</h1>
        <button pButton type="button" (click)="visibleSidebar5 = false" label="Save" class="ui-button-success"></button>
        <button pButton type="button" (click)="visibleSidebar5 = false" label="Cancel" class="ui-button-secondary"></button>
    </p-sidebar>

    <button pButton type="button" (click)="visibleSidebar1 = true" icon="pi pi-arrow-right"></button>
    <button pButton type="button" (click)="visibleSidebar2 = true" icon="pi pi-arrow-left"></button>
    <button pButton type="button" (click)="visibleSidebar3 = true" icon="pi pi-arrow-down"></button>
    <button pButton type="button" (click)="visibleSidebar4 = true" icon="pi pi-arrow-up"></button>
    <button pButton type="button" (click)="visibleSidebar5 = true" icon="pi pi-th-large"></button>
</div>

<div class="content-section documentation">
    <p-tabView effect="fade">
        <p-tabPanel header="Documentation">
            <h3>Import</h3>
<pre>
<code class="language-typescript" pCode ngNonBindable>
import &#123;SidebarModule&#125; from 'primeng/sidebar';
</code>
</pre>

            <h3>Getting Started</h3>
            <p>Sidebar is used as a container and visibility is controlled with visible property.</p>

<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-sidebar [(visible)]="display"&gt;
    Content
&lt;/p-sidebar&gt;

&lt;button type="text" (click)="display = true" pButton icon="pi pi-plus" label="Show"&gt;&lt;/button&gt;
</code>
</pre>

            <h3>Position</h3>
            <p>Sidebar can either be located as the left (default), right, top or bottom of the screen depending on the position property.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-sidebar [(visible)]="display" position="right"&gt;
    Content
&lt;/p-sidebar&gt;
</code>
</pre>

            <h3>Size</h3>
            <p>Sidebar size can be changed using a fixed value or using one of the three predefined ones.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-sidebar [(visible)]="display" [ngStyle]="&#123;width:'30em'&#125;"&gt;&lt;/p-sidebar&gt;

&lt;p-sidebar [(visible)]="display" styleClass="ui-sidebar-sm"&gt;&lt;/p-sidebar&gt;
&lt;p-sidebar [(visible)]="display" styleClass="ui-sidebar-md"&gt;&lt;/p-sidebar&gt;
&lt;p-sidebar [(visible)]="display" styleClass="ui-sidebar-lg"&gt;&lt;/p-sidebar&gt;
</code>
</pre>

            <h3>Full Screen</h3>
            <p>Full screen mode allows the sidebar to cover whole screen.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-sidebar [(visible)]="display" [fullScreen]="true"&gt;
Content
&lt;/p-sidebar&gt;
</code>
</pre>

            <h3>Properties</h3>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>visible</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Specifies the visibility of the dialog.</td>
                        </tr>
                        <tr>
                            <td>position</td>
                            <td>string</td>
                            <td>left</td>
                            <td>Specifies the position of the sidebar, valid values are "left", "right", "bottom" and "top".</td>
                        </tr>
                        <tr>
                            <td>fullScreen</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Adds a close icon to the header to hide the dialog.</td>
                        </tr>
                        <tr>
                            <td>appendTo</td>
                            <td>any</td>
                            <td>null</td>
                            <td>Target element to attach the dialog, valid values are "body" or a local ng-template variable of another element.</td>
                        </tr>
                        <tr>
                            <td>style</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Inline style of the component.</td>
                        </tr>
                        <tr>
                            <td>styleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the component.</td>
                        </tr>
                        <tr>
                            <td>blockScroll</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Whether to block scrolling of the document when sidebar is active.</td>
                        </tr>
                        <tr>
                            <td>baseZIndex</td>
                            <td>number</td>
                            <td>0</td>
                            <td>Base zIndex value to use in layering.</td>
                        </tr>
                        <tr>
                            <td>autoZIndex</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Whether to automatically manage layering.</td>
                        </tr>
                        <tr>
                            <td>modal</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Whether an overlay mask is displayed behind the sidebar.</td>
                        </tr>
                        <tr>
                            <td>dismissible</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Whether to dismiss sidebar on click of the mask.</td>
                        </tr>
                        <tr>
                            <td>showCloseIcon</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Whether to display the close icon.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h3>Events</h3>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Parameters</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>onShow</td>
                            <td>event: Event object</td>
                            <td>Callback to invoke when dialog is shown.</td>
                        </tr>
                        <tr>
                            <td>onHide</td>
                            <td>event: Event object</td>
                            <td>Callback to invoke when dialog is hidden.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h3>Styling</h3>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Element</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>ui-sidebar</td>
                            <td>Container element</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-left</td>
                            <td>Container element of left sidebar.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-right</td>
                            <td>Container element of right sidebar.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-top</td>
                            <td>Container element of top sidebar.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-bottom</td>
                            <td>Container element of bottom sidebar.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-full</td>
                            <td>Container element of a full screen sidebar.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-active</td>
                            <td>Container element when sidebar is visible.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-close</td>
                            <td>Close anchor element.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-sm</td>
                            <td>Small sized sidebar.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-md</td>
                            <td>Medium sized sidebar.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-lg</td>
                            <td>Large sized sidebar.</td>
                        </tr>
                        <tr>
                            <td>ui-sidebar-mask</td>
                            <td>Modal layer of the sidebar.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h3>Dependencies</h3>
            <p>None.</p>
        </p-tabPanel>

        <p-tabPanel header="Source">
            <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/sidebar" class="btn-viewsource" target="_blank">
                <i class="fa fa-github"></i>
                <span>View on GitHub</span>
            </a>

<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-sidebar [(visible)]="visibleSidebar1" [baseZIndex]="10000"&gt;
    &lt;h1 style="font-weight:normal"&gt;Left Sidebar&lt;/h1&gt;
    &lt;button pButton type="button" (click)="visibleSidebar1 = false" label="Save" class="ui-button-success"&gt;&lt;/button&gt;
    &lt;button pButton type="button" (click)="visibleSidebar1 = false" label="Cancel" class="ui-button-secondary"&gt;&lt;/button&gt;
&lt;/p-sidebar&gt;

&lt;p-sidebar [(visible)]="visibleSidebar2" position="right" [baseZIndex]="10000"&gt;
    &lt;h1 style="font-weight:normal"&gt;Right Sidebar&lt;/h1&gt;
    &lt;button pButton type="button" (click)="visibleSidebar2 = false" label="Save" class="ui-button-success"&gt;&lt;/button&gt;
    &lt;button pButton type="button" (click)="visibleSidebar2 = false" label="Cancel" class="ui-button-secondary"&gt;&lt;/button&gt;
&lt;/p-sidebar&gt;

&lt;p-sidebar [(visible)]="visibleSidebar3" position="top" [baseZIndex]="10000"&gt;
    &lt;h1 style="font-weight:normal"&gt;Top Sidebar&lt;/h1&gt;
    &lt;button pButton type="button" (click)="visibleSidebar3 = false" label="Save" class="ui-button-success"&gt;&lt;/button&gt;
    &lt;button pButton type="button" (click)="visibleSidebar3 = false" label="Cancel" class="ui-button-secondary"&gt;&lt;/button&gt;
&lt;/p-sidebar&gt;

&lt;p-sidebar [(visible)]="visibleSidebar4" position="bottom" [baseZIndex]="10000"&gt;
    &lt;h1 style="font-weight:normal"&gt;Bottom Sidebar&lt;/h1&gt;
    &lt;button pButton type="button" (click)="visibleSidebar4 = false" label="Save" class="ui-button-success"&gt;&lt;/button&gt;
    &lt;button pButton type="button" (click)="visibleSidebar4 = false" label="Cancel" class="ui-button-secondary"&gt;&lt;/button&gt;
&lt;/p-sidebar&gt;

&lt;p-sidebar [(visible)]="visibleSidebar5" [fullScreen]="true" [baseZIndex]="10000"&gt;
    &lt;h1 style="font-weight:normal"&gt;Full Screen Sidebar&lt;/h1&gt;
    &lt;button pButton type="button" (click)="visibleSidebar5 = false" label="Save" class="ui-button-success"&gt;&lt;/button&gt;
    &lt;button pButton type="button" (click)="visibleSidebar5 = false" label="Cancel" class="ui-button-secondary"&gt;&lt;/button&gt;
&lt;/p-sidebar&gt;

&lt;button pButton type="button" (click)="visibleSidebar1 = true" icon="pi pi-arrow-right"&gt;&lt;/button&gt;
&lt;button pButton type="button" (click)="visibleSidebar2 = true" icon="pi pi-arrow-left"&gt;&lt;/button&gt;
&lt;button pButton type="button" (click)="visibleSidebar3 = true" icon="pi pi-arrow-down"&gt;&lt;/button&gt;
&lt;button pButton type="button" (click)="visibleSidebar4 = true" icon="pi pi-arrow-up"&gt;&lt;/button&gt;
&lt;button pButton type="button" (click)="visibleSidebar5 = true" icon="pi pi-th-large"&gt;&lt;/button&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode ngNonBindable>
export class SidebarDemo &#123;

    visibleSidebar1;

    visibleSidebar2;

    visibleSidebar3;

    visibleSidebar4;

    visibleSidebar5;

&#125;
</code>
</pre>
            </p-tabPanel>
        </p-tabView>
</div>
